const mongoose = require('mongoose')
const config = require('./config')
mongoose.connect(
  config.MONGODB_URL,
  {
    useNewUrlParser: true
  },
  (err) => {
    if (!err) {//连接成功了
      console.log('database connect success');
    } else {
      throw err;
    }
  }
);

module.exports = mongoose